package com.jiashihui.schema_lgorithm.schema.proxy;

/**
 * @author jiashihui
 * @describe: 中介代理
 * @date 2019/03/14
 */
public class HZFangProxyImpl implements Rent {

    /* 租客 */
    private Rent renter;

    public HZFangProxyImpl(Rent renter) {
        super();
        this.renter = renter;
    }

    @Override
    public void rentHouse() {
        beforeProxy();
        renter.rentHouse();
        afterProxy();
        System.out.println("HZFangProxy help Renter rent a house!");
    }

    /* 代理之前 */
    private void beforeProxy() {
        System.out.println("before proxy");
    }

    /* 代理之前 */
    private void afterProxy() {
        System.out.println("after proxy");
    }
}
